package com.ytjj.qmyx.admin.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.admin.model.PushTask;
import com.ytjj.qmyx.admin.service.PushTaskService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;


/**
 *
 * 推送任务
 */
@RestController
@AllArgsConstructor
@RequestMapping("/pushTask")
public class PushTaskController {

    private PushTaskService pushTaskService;

    @GetMapping("/page")
    public CommonResult selectPushTaskPage(Integer pageNum, Integer pageSize) {
        return CommonResult.success(pushTaskService.selectPushTaskPage(pageNum,pageSize));
    }

    @PostMapping("/insertPushTask")
    public CommonResult insertPushTask(@RequestBody PushTask pushTask) {
        return CommonResult.success(pushTaskService.insertPushTask(pushTask));
    }

    @PostMapping("/updatePushTask")
    public CommonResult updatePushTask(@RequestBody PushTask pushTask) {
        return CommonResult.success(pushTaskService.updatePushTask(pushTask));
    }

    @GetMapping("/selectPushTask")
    public CommonResult selectPushTask(Integer id) {
        return CommonResult.success(pushTaskService.selectPushTask(id));
    }

}
